/**
 * @author:cloud.lg
 * @date:2021.3.26
 * @description:这里主要包含后台接口的定义
 * @module user 用户模块
 */
import {get, post, fetch } from '../fetch'

//登录
export const login = (params) => post('/login', params, 'json');

//获取用户信息
export const getUserInfo = (params) => get('/getInfo', params, 'json');

//退出登录
export const logOut = (params) => fetch('/system/user/profile/logout', {}, 'json', 'delete');

//用户管理列表
export const userFindByPage = (params) => get('/system/user/list', params, 'json');

// //查询登录用户基本信息
// export const getUserInfo = (params) => get('/user/tcbUser/queryUserInfo', params, 'json');

//添加用户
export const addUser = (params) => post('/system/user', params, 'json');

//查询用户详情
export const getUserDetail = (params) => get('/system/user/' + params.id, {}, 'json');

//用户状态修改
export const updateUserEnabl = (params) => fetch('/system/user/changeStatus', params, 'json', 'put');

//用户修改
export const editUser = (params) => fetch('/system/user', params, 'json', 'put');

//重置密码
export const resetPwd = (params) => fetch('/system/user/resetPwd', params, 'json', 'put');

//修改密码
export const updateUserPwd = (params) => fetch('/system/user/profile/updatePwd?oldPassword=' + params.oldPassword + '&newPassword=' + params.newPassword, {}, 'json', 'put');

//操作日志
export const tcbUserGatewayLog = (params) => post('/user/tcbUserGatewayLog/findByPage', params, 'json');

//操作日志
export const logDetails = (params) => get('/user/tcbUserGatewayLog/queryByGatewayLogId', params, 'json');

//添加部门角色岗位小组成员
export const addBatchUser = (params) => post('/user/tcbUser/addBatchUser', params, 'json');

//部门角色岗位小组成员查询
export const findSignUserByPage = (params) => post('/user/tcbUser/findSignUserByPage', params, 'json');

//查询省市区
export const findProvinceAndCityTree = (params) => get('/user/tcbMenu/findProvinceAndCityTree', params, 'json');

//查询当前组织下的用户选项
export const getUserList = (params) => get('/system/user/list/optionSelect', params, 'json');

//添加部门成员
export const deptAddUser = (params) => post('/system/dept/deptAddUser', params, 'json');

//添加岗位成员
export const postAddUser = (params) => post('/system/post/postAddUser', params, 'json');

//添加角色成员
export const roleAddUser = (params) => post('/system/role/roleAddUser', params, 'json');

//添加小组成员
export const groupAddUser = (params) => post('/system/group/groupAddUser', params, 'json');